package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"zbn-oil-consumption/config"
	"zbn-oil-consumption/routes"
)

func main() {
	r := gin.Default()
	app := routes.SetupRouter(r)
	addr := fmt.Sprintf(":%d", config.Cfg.System.Port)
	if err := app.Run(addr); err != nil {
		panic("服务器启动失败: " + err.Error())
	}

	fmt.Println("监听服务", addr)
}
